################################################################################
#
# jazz2-native
#
################################################################################

JAZZ2_NATIVE_VERSION = 3.4.0
JAZZ2_NATIVE_SITE = https://github.com/deathkiller/jazz2-native.git
JAZZ2_NATIVE_SITE_METHOD = git
JAZZ2_NATIVE_GIT_SUBMODULES = YES
JAZZ2_NATIVE_LICENSE = GPL-3.0
JAZZ2_NATIVE_LICENSE_FILE = LICENSE

JAZZ2_NATIVE_DEPENDENCIES += libcurl sdl2 openal libopenmpt zlib

JAZZ2_NATIVE_SUPPORTS_IN_SOURCE_BUILD = NO

JAZZ2_NATIVE_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release
JAZZ2_NATIVE_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF
JAZZ2_NATIVE_CONF_OPTS += -DNCINE_LINUX_PACKAGE="jazz2"
JAZZ2_NATIVE_CONF_OPTS += -DNCINE_DOWNLOAD_DEPENDENCIES=OFF

ifeq ($(BR2_PACKAGE_XORG7)$(BR2_PACKAGE_HAS_LIBGL),yy)
    JAZZ2_NATIVE_DEPENDENCIES += libglew
endif

ifeq ($(BR2_PACKAGE_LIBGLFW),y)
    JAZZ2_NATIVE_DEPENDENCIES += libglfw
    JAZZ2_NATIVE_CONF_OPTS += -DNCINE_PREFERRED_BACKEND=GLFW
else ifeq ($(BR2_PACKAGE_BATOCERA_GLES3),y)
    JAZZ2_NATIVE_CONF_OPTS += -DNCINE_PREFERRED_BACKEND=SDL2
    JAZZ2_NATIVE_CONF_OPTS += -DNCINE_WITH_OPENGLES=ON
endif

$(eval $(cmake-package))
